package com.itheima.feign;

import com.itheima.domain.mongo.*;
import com.itheima.vo.PageBeanVo;
import com.itheima.vo.UserLikeCountVo;
import org.bson.types.ObjectId;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@FeignClient("mongdb-service")
public interface MongDbServiceFeign {
    // ===========================/visitor===============================
    @GetMapping("/visitor/findVisitorList")
    List<Visitor> findVisitorList(@RequestParam("userId") Long userId,
                                  @RequestParam("lastAccessTime") String lastAccessTime);

    // ===========================/video===============================
    @GetMapping("/video/findVideo")
    PageBeanVo findVideo(@RequestParam("userId") Long userId,
                         @RequestParam("pageNum") Integer pageNum,
                         @RequestParam("pageSize") Integer pageSize);

    @PostMapping("/video/saveVideo")
    void saveVideo(@RequestBody Video video) ;

    @GetMapping("/video/findUserVideoList")
    PageBeanVo findUserVideoList(@RequestParam("uid") Long uid,
                                 @RequestParam("pageNum") Integer pageNum,
                                 @RequestParam("pageSize") Integer pageSize);

    // ===========================/userLocation===============================
    @PostMapping("/userLocation/save")
    void save(@RequestParam("userId") Long userId,
              @RequestParam("longitude") Double longitude,
              @RequestParam("latitude") Double latitude,
              @RequestParam("address") String address);

    @GetMapping("/userLocation/findNearUserIdList")
    List<Long> findNearUserIdList(@RequestParam("userId") Long userId,
                                  @RequestParam("distance") Long distance);

    // ===========================/userLike===============================
    @PostMapping("/userLike/userLikeSave")
    void userLikeSave(@RequestParam("userId") Long userId,
                      @RequestParam("likeUserId") Long likeUserId);

    @GetMapping("/userLike/isMutualLike")
    boolean isMutualLike(@RequestParam("userId") Long userId,
                         @RequestParam("likeUserId") Long likeUserId);

    @DeleteMapping("/userLike/userLikeDelete")
    void userLikeDelete(@RequestParam("userId") Long userId,
                        @RequestParam("likeUserId") Long likeUserId);

    @GetMapping("/userLike/findUserCount")
    UserLikeCountVo findUserCount(@RequestParam("userId") Long userId);

    @GetMapping("/userLike/findUserList")
    PageBeanVo findUserList(@RequestParam("userId") Long userId,
                            @RequestParam("type") Integer type,
                            @RequestParam("pageNum") Integer pageNum,
                            @RequestParam("pageSize") Integer pageSize);
    
    
    
    // ===========================/soundTime===============================
    @PostMapping("/soundTime/save")
    void save(@RequestBody SoundTime soundTime);


    //根据id查询用户剩余的次数
    @GetMapping("/soundTime/findSoundTime")
    SoundTime findSoundTime(@RequestParam("userId") Long userId);


    //更新语音获取次数
    @GetMapping("/soundTime/updateTimes")
    void updateTimes(@RequestParam("count") int count);

    // ===========================/sound===============================
    @PostMapping("/sound/save")
    void save(@RequestBody Sound sound);

    //接收查找语音
    @GetMapping("/sound/findByGender")
    Sound findByGender(@RequestParam("gender") String gender);

    //根据语音id删除
    @GetMapping("/sound/soundDeleteById")
    void soundDeleteById(@RequestParam("id") ObjectId id);

    // ===========================/recommendUser===============================
    @GetMapping("/recommendUser/findMaxScore")
    RecommendUser findMaxScore(@RequestParam("userId") Long userId);

    @GetMapping("/recommendUser/findRecommend")
    PageBeanVo findRecommendUser(@RequestParam("userId") Long userId,
                                 @RequestParam("pageNum") Integer pageNum,
                                 @RequestParam("pageSize") Integer pageSize);

    @GetMapping("/recommendUser/findRecommendUser")
    RecommendUser findRecommendUser(@RequestParam("userId") Long userId,
                                    @RequestParam("recommendUserId") Long recommendUserId);

    // ===========================/movement===============================
    @PostMapping("/movement/saveMovement")
    void saveMovement(@RequestBody Movement movement);

    @GetMapping("/movement/findMyMovement")
    PageBeanVo findMyMovement(@RequestParam("userId") Long userId,
                              @RequestParam("pageNum") Integer pageNum,
                              @RequestParam("pageSize")Integer pageSize);

    @GetMapping("/movement/findMyFriendMovement")
    PageBeanVo findMyFriendMovement(@RequestParam("userId") Long userId,
                                    @RequestParam("pageNum") Integer pageNum,
                                    @RequestParam("pageSize") Integer pageSize);

    @GetMapping("/movement/findRecommendMovement")
    PageBeanVo findRecommendMovement(@RequestParam("userId") Long userId,
                                     @RequestParam("pageNum")Integer pageNum,
                                     @RequestParam("pageSize")Integer pageSize);

    @GetMapping("/movement/findMovementById")
    Movement findMovementById(@RequestParam("movementId") String movementId);

    @GetMapping("/movement/findMovementList")
    PageBeanVo findMovementList(@RequestParam("uid") Long uid,
                                @RequestParam("stateInt") Integer stateInt,
                                @RequestParam("pageNum") Integer pageNum,
                                @RequestParam("pageSize") Integer pageSize) ;

    @PostMapping("/movement/updateMovementState")
    void updateMovementState(@RequestBody Movement movement);

    // ===========================/idCreate===============================
    @GetMapping("/idCreate/getNextId")
    Long getNextId(@RequestParam("collName")String collName);
    
    // ===========================/friend===============================
    @PostMapping("/friend/save")
    void save(@RequestParam("userId")Long userId, @RequestParam("friendId")Long friendId);

    @GetMapping("/friend/findByUserId")
    PageBeanVo findByUserId(@RequestParam("userId") Long userId,
                            @RequestParam("pageNum") Integer pageNum,
                            @RequestParam("pageSize") Integer pageSize);

    @DeleteMapping("/friend/delete")
    void delete(@RequestParam("userId")Long userId,
                @RequestParam("friendId")Long friendId);


    // ===========================/focusUser===============================
    @PostMapping("/focusUser/save")
    void save(@RequestBody FocusUser focusUser);

    @PostMapping("/focusUser/delete")
    void delete(@RequestBody FocusUser focusUser);
    
    // ===========================/comment===============================
    @PostMapping("/comment/saveMovementComment")
    Integer saveMovementComment(@RequestBody Comment comment);

    @PostMapping("/comment/deleteMovementComment")
    Integer deleteMovementComment(@RequestBody Comment comment);

    @PostMapping("/comment/findMovementComment")
    PageBeanVo findMovementComment(@RequestParam("movementId") String movementId,
                                   @RequestParam("pageNum") Integer pageNum,
                                   @RequestParam("pageSize") Integer pageSize) ;

    @GetMapping("/comment/findCountComment")
    PageBeanVo findCountComment(@RequestParam("userId")Long userId,
                                @RequestParam("commentType")Integer commentType,
                                @RequestParam("pageNum")Integer pageNum,
                                @RequestParam("pageSize")Integer pageSize) ;

    @PostMapping("/comment/comment")
    void saveVideoComment(@RequestBody Comment comment) ;

    @PostMapping("/comment/deleteVideoComment")
    void deleteVideoComment(@RequestBody Comment comment);

    //视频评论列表
    @GetMapping("/comment/findVideoComment")
    PageBeanVo findVideoComment(@RequestParam("videoId")String videoId,
                                @RequestParam("pageNum")Integer pageNum,
                                @RequestParam("pageSize")Integer pageSize) ;

    @PostMapping("/comment/saveVideoCommentLike")
    void saveVideoCommentLike(@RequestBody Comment comment);

    @PostMapping("/comment/deleteVideoCommentLike")
    void deleteVideoCommentLike( @RequestBody Comment comment);

    @PostMapping("/comment/saveMovementCommentLike")
    Integer saveMovementCommentLike(@RequestBody Comment comment);

    @PostMapping("/comment/deleteMovementCommentLike")
    Integer deleteMovementCommentLike(@RequestBody Comment comment);
    

}